import axios from '@/libs/api.request'
import { getToken } from '@/libs/util'
// =============== news-system/advertisements/list.vue =========================
let auth_token = getToken();
//违章
export const getTableData = (page_current, page_size, searchData) => {
  return axios.request({
    url: 'api/v1.cuser.break_rule/index',
    params: {
      page_current: page_current,
      page_size: page_size,
      auth_token:auth_token,
      status :searchData.status,
    },
    method: 'get'
  })
}

//获取车牌
export const getCar = () => {
  return axios.request({
    url: 'api/v1.cuser.break_rule/get_car',
    params: {
      auth_token:auth_token,
    },
    method: 'get'
  })
}

//筛选条件
export const breakSearch = (car_id,break_time) => {
  let params = {car_id:car_id,break_time:break_time,auth_token:auth_token};
  return axios.request({
    url: 'api/v1.cuser.break_rule/break_search',
    data:params,
    method: 'post'
  })
}


//添加
export const addBreak = (formData) => {
  formData.auth_token = auth_token;
  return axios.request({
    url: 'api/v1.cuser.break_rule/create',
    data:formData,
    method: 'post'
  })
}


export const getInfo = (break_id) => {
  return axios.request({
    url: 'api/v1.cuser.break_rule/read',
    params: {
      break_id: break_id,
      auth_token:auth_token,
    },
    method: 'get'
  })
}

//筛选数据
export const getData = () => {
  return axios.request({
    url: 'api/v1.cuser.index/get_data',
    params: {
      auth_token:auth_token,
    },
    method: 'get'
  })
}

//处理违章
export const changeStatus = (break_id) => {
	 let formData={
    	  break_id:break_id,
    	  auth_token:auth_token,
   };
	
  return axios.request({
    url: 'api/v1.cuser.break_rule/change_status',
    data:formData,
    method: 'post'
  })
}
